import java.util.Random;

public class test632 {
    public static void main(String[] args) {
        Random random = new Random();
        int winCount = 0;
        int totalGames = 10000;
        for (int i = 0; i < totalGames; i++) {
            int die1 = random.nextInt(6) + 1;
            int die2 = random.nextInt(6) + 1;
            int sum = die1 + die2;
            if (sum == 7 || sum == 11) {
                winCount++;
            } else if (sum != 2 && sum != 3 && sum != 12) {
                int point = sum;
                while (true) {
                    die1 = random.nextInt(6) + 1;
                    die2 = random.nextInt(6) + 1;
                    sum = die1 + die2;
                    if (sum == point) {
                        winCount++;
                        break;
                    } else if (sum == 7) {
                        break;
                    }
                }
            }
        }
        System.out.println("运行" + totalGames + "次，赢的次数：" + winCount);
    }
}

